import { defHttp } from '/@/utils/http/axios';

enum Api {
  GetBookList = '/book/list',
  CreateBook = '/book/create',
  UpdateBook = '/book/update',
  DeleteBook = '/book/del',
  GetBookDetail = '/book/detail',
  GetBookTypeSelect = '/book/bookTypeSelect',
}

export class booksApi {
  static async getBookList(params) {
    return defHttp.get({ url: Api.GetBookList, params }, { isTransformResponse: false });
  }
  static async createBook(data) {
    return defHttp.post({ url: Api.CreateBook, data });
  }
  static async updateBook(data) {
    return defHttp.post({ url: Api.UpdateBook, data });
  }
  static async deleteBook(data) {
    return defHttp.post({ url: Api.DeleteBook, data });
  }
  static async getBookDetail(params) {
    return defHttp.get({ url: Api.GetBookDetail, params });
  }
  static async getBookTypeSelect() {
    return defHttp.get({ url: Api.GetBookTypeSelect });
  }
}
